﻿@model IEnumerable<wUniApp.MVC.App_Data.Customer>
@using wUniApp.MVC.App_GlobalResources
@{
    ViewBag.Title = wUniApp.MVC.App_GlobalResources.Resources.Index;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@Html.GetTitle()


@using (Html.BeginForm("IndexSort", "Customers", FormMethod.Get))
{
  <p>
    Filter: @Html.TextBox("Filter", null, new { @class = "control" })
    <input type="submit" value="OK" class="btn btn-default" />
  </p>
}
<table class="table">
    <tr>
        <th>
          @Html.DisplayNameFor(model => model.Product.Name)
        </th>
        <th>
          @Html.GroupByLink("FirstName", "IndexSort", "Customers")
            @*@Html.DisplayNameFor(model => model.FirstName)*@
        </th>
        <th>
          @Html.GroupByLink("LastName", "IndexSort", "Customers")
        </th>
        <th>
           @Html.DisplayNameFor(model => model.Age)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.MonthlyIncome)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ChildsCount)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Notes)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Email)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Product.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.FirstName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LastName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Age)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.MonthlyIncome)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ChildsCount)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Notes)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
        <td>

          @Html.EDDButtons(item.Id)
            @*@Html.ActionLink(Resources.Edit, "Edit", new { id=item.Id }) |
            @Html.ActionLink(Resources.Details, "Details", new { id=item.Id }) |
            @Html.ActionLink(Resources.Delete, "Delete", new { id=item.Id })*@
        </td>
    </tr>
}

</table>


<p>
  @Html.ActionLink(Resources.CreateNew, "Create")
</p>
